﻿<phone:PhoneApplicationPage x:Class="GroupChallenge.PlayerAdminWP7.MainPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:local="clr-namespace:GroupChallenge.PlayerAdminWP7"
                            mc:Ignorable="d"
                            d:DesignWidth="480"
                            d:DesignHeight="696"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            shell:SystemTray.IsVisible="True">
    <phone:PhoneApplicationPage.Resources>
        <local:PlayerPictureViewModel x:Key="PlayerPicture" />
    </phone:PhoneApplicationPage.Resources>
    <Grid x:Name="LayoutRoot"
          Background="Transparent"
          DataContext="{Binding Source={StaticResource PlayerPicture}}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel"
                    Grid.Row="0"
                    Margin="12,0,12,0">
            <StackPanel.Background>
                <LinearGradientBrush EndPoint="0.5,1"
                                     StartPoint="0.5,0">
                    <GradientStop Color="Black"
                                  Offset="0" />
                    <GradientStop Color="#FF0A78FF"
                                  Offset="1" />
                </LinearGradientBrush>
            </StackPanel.Background>
            <TextBlock Text="Group Challenge"
                       Style="{StaticResource PhoneTextNormalStyle}" />
            <TextBlock Text="Player Picture"
                       Margin="9,-7,0,0"
                       Style="{StaticResource PhoneTextTitle1Style}" />
        </StackPanel>
        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel"
              Grid.Row="1"
              Margin="12,0,12,0"
              Background="DarkBlue">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="45" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Image Name="PictureImage"
                   Stretch="Uniform"
                   Source="{Binding Path=Photo}" />
            <TextBlock Text="{Binding Path=LastMessage}"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Style="{StaticResource PhoneTextNormalStyle}"
                       Grid.Row="1" />
            <StackPanel Grid.Row="2"
                        Orientation="Horizontal">
                <TextBlock VerticalAlignment="Center"
                           Foreground="#FFC7A766"
                           Text="Host:" />
                <TextBox HorizontalAlignment="Left"
                         Text="{Binding Path=UploadServer, Mode=TwoWay}" />
            </StackPanel>
        </Grid>
    </Grid>
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True"
                              IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.feature.camera.rest.png"
                                            Text="Camera"
                                            Click="TakePictureButton_Click" />
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.add.rest.png"
                                            Text="Upload"
                                            Click="UploadPictureButton_Click" />
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="Take Picture"
                                              Click="TakePictureButton_Click" />
                <shell:ApplicationBarMenuItem Text="Upload"
                                              Click="UploadPictureButton_Click" />
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>